{extend name="public:base"/}

{block name="title"}商品属性列表{/block}
{block name="style"}{/block}

{block name="main"}

<section class="content">

    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header m-b-sm">
                    <h3 class="box-title">商品属性列表</h3>
                </div>
                <!--
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="/backend/addons/rf-merchants/config/index"> 配置管理</a></li>
                        <li><a href="/backend/addons/rf-merchants/config-cate/index"> 配置分类</a></li>
                        <li class="pull-right">
                            <a class="btn btn-primary btn-xs" href="/backend/addons/rf-wechat/rule/edit"><i
                                    class="fa fa-plus"></i> 创建</a>
                        </li>
                    </ul>
                </div>
                -->

                <div class="farPaddingJustV from-search">
                    <div class="col-sm-8">
                        <form method="get" action="">
                            <div class="col-sm-3">
                                <select class="form-control" name="type_id">
                                    <option value="0">所有模型</option>
                                    <?php if(!empty($goodsType)){foreach($goodsType as $k=>$v):?>
                                    <option <?=input('get.type_id')==$v['id']?'selected="selected"':''?> value="<?=$v['id']?>"><?=$v['type_name']?></option>
                                    <?php endforeach;}?>
                                </select>
                            </div>

                            <div class="col-sm-3">
                                <div class="form-row">
                                    <span class="input-group-btn">
                                        <button class="btn btn-white"><i class="fa fa-search"></i> 搜索</button>
                                    </span>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>

                <div class="clearfix"></div>

                <div class="box-body table-responsive">

                                        <div class="menu-buttons m-b-sm">
                        <a href="<?=url('admin/GoodsAttribute/create')?>" class="btn btn-sm btn-primary"><i class="fa fa-plus" ></i> 新增商品属性</a>
                    </div>
                    
                    <table id="table-index" class="table table-hover"><thead>
                    <tr>
                        <th style="width: 10%;">ID</th>
     
                        <th style="width: 10%;">属性名称</th>
          
                        <th style="width: 10%;">所属商品模型</th>

                        <th style="width: 10%;">属性值的录入方式</th>
                        <th style="width: 20%;">可选值列表</th>
                        <th style="width: 10%;">筛选</th>

                        <th style="width: 10%;">属性排序</th>
                             <th style="width: 10%;">操作</th>
                    </tr>

                    </thead>
                        <tbody>

 <?php if(!empty($dataProvider)){foreach($dataProvider as $k=>$v): ?>
                        <tr>
                            <td><?=$v['attr_id']?></td>
            
                            <td>
                                <span class="m-l-sm"><?=$v['attr_name']?></span>
                            </td>
                    
                            <td>
                                <span class="m-l-sm"><?=$v['getGoodsType']['type_name']?></span>
                            </td>

                            <td>
                                <span class="m-l-sm"><?=$v['attr_input_type']?></span>
                            </td>

                            <td>
                                <span class="m-l-sm"><?=$v['attr_values']?></span>
                            </td>

                            <td>
                                <span class="m-l-sm"><?=$v['attr_index']?></span>
                            </td>

                            <td>
                                <span class="m-l-sm"><?=$v['order']?></span>
                            </td>
            
                            <td>
                                <a class="btn btn-primary btn-xs" title="编辑" href="<?=url('admin/GoodsAttribute/update',['attr_id'=>$v['attr_id']])?>"><i class="fa fa-edit"></i> 编辑</a>

                                <a class="btn btn-danger btn-xs" title="删除" href="<?=url('admin/GoodsAttribute/index',['attr_id'=>$v['attr_id']])?>" onclick="ptyConfirmDelete('<?=url('admin/GoodsAttribute/delete',['attr_id'=>$v['attr_id']])?>');return false;"><i class="fa fa-trash-o"></i> 删除</a>
                                
                            </td>
                        </tr>

  <?php endforeach; } ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
</section>
{/block}

{block name="js"}
{/block}


